Fix for tool-bar confusion in read-key.
authorChong Yidong <cyd@gnu.org>
Fri, 27 Apr 2012 02:24:38 +0000 (10:24 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 27 Apr 2012 02:24:38 +0000 (10:24 +0800)
* lisp/subr.el (read-key): Avoid running filter function when setting
up temporary tool bar entries.

lisp/ChangeLog
lisp/subr.el

index 4e2d390f33fb578c72b6fd9bd97dbe2725f78a41..63f90fd62a5ec3a1dd9305d107cc1962f790cc83 100644 (file)
@@ -1,3 +1,8 @@
+2012-04-27  Chong Yidong  <cyd@gnu.org>
+
+       * subr.el (read-key): Avoid running filter function when setting
+       up temporary tool bar entries (Bug#9922).
+
 2012-04-26  Andreas Schwab  <schwab@linux-m68k.org>
 
        * vc/vc-git.el (vc-git-state): Fix regexp matching diff output.
index 3b120e6ff6a93bab0939e55e92782e00c3a583a8..9b293bb21ac6da3e0cb876c584e25fc6111a2bce 100644 (file)
@@ -2019,7 +2019,10 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
            (let ((map (make-sparse-keymap)))
              ;; Don't hide the menu-bar and tool-bar entries.
              (define-key map [menu-bar] (lookup-key global-map [menu-bar]))
-             (define-key map [tool-bar] (lookup-key global-map [tool-bar]))
+             (define-key map [tool-bar]
+              ;; This hack avoids evaluating the :filter (Bug#9922).
+              (or (cdr (assq 'tool-bar global-map))
+                  (lookup-key global-map [tool-bar])))
              map))
          (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0))
       (cancel-timer timer)